//获取用户信息
export const getUserInfo = () => {
	const res = localStorage.getItem('user_info')
	return res ? JSON.parse(res) : {userId:'',token:''}
}

//重置用户信息
export const setUserInfo = (data) => localStorage.setItem('user_info',JSON.stringify(data))

//清空用户信息
export const removeUserInfo = () => localStorage.removeItem('user_info')


//获取历史记录
export const getHistory = () => {
	const res = localStorage.getItem('history')
	return res ? JSON.parse(res) : []
}

//重置历史记录
export const setHistory = data => localStorage.setItem('history',JSON.stringify(data))

//清空历史记录
export const removeHistory = () => localStorage.removeItem('history')